/*********************************************************************************
Trigger Name: NMROpptyAmountUpdate
Author: Accenture IDC
Date:4/19/2012 
Requirement/Project Name: NMR  
Requirement Description:  Update Opportunity Amount as per Override Amount Update
Version History: Created
**********************************************************************************/
trigger NMROpptyAmountUpdate on Opportunity (before update) {
    public static Id nmrOpptyRecordTypeID = RecordTypeHelper.GetRecordTypeID('Opportunity', 'NMR Opportunity');//NMR recordtype for opportunity
    Map<Id,Opportunity> OpptyMap = new Map<Id,Opportunity>();
    for(Opportunity opp:Trigger.new){
        //Only add those opportunities with recent changed override amount
        if(opp.recordtypeID == nmrOpptyRecordTypeID && Trigger.oldmap.get(opp.Id).Override_Amount__c != opp.Override_Amount__c){
            OpptyMap.put(opp.Id,opp);
        }
    }
    //Call the NMROpptyAmountUpdateCls to run the update amount logic
    if(OpptyMap.size()>0){
        NMROpptyAmountUpdateCls.updateOppty(OpptyMap);
    }
}